package com.atguigu.baseservice.handler.exception;

import com.atguigu.baseservice.result.ResultCodeEnum;
import lombok.Data;

@Data
public class GuliException extends RuntimeException {
    private static final long serialVersionUID = -4198842878380665454L;
    //状态码
    private Integer code;

    //提示信息
    private String msg;

    //构造方法
    public GuliException() {
        super();
    }

    //自定义异常构造方法
    public GuliException(ResultCodeEnum resultCodeEnum){
        super(resultCodeEnum.getMsg());
        this.code = resultCodeEnum.getCode();
        this.msg = resultCodeEnum.getMsg();
    }
}
